﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kiel.Pdf
{
	/// <summary>
	/// Represents a PDF Boolean Object.
	/// </summary>
	class PdfBoolean : IPdfObject
	{
		public PdfBoolean(bool value)
		{
			this.Value = value;
		}

		public bool Value { get; set; }

		public static PdfBoolean Parse(string value)
		{
			if (value == "true")
				return new PdfBoolean(true);
			if (value == "false")
				return new PdfBoolean(false);
			
			throw new ArgumentException(string.Format("{0} is not a valid Boolean Object.", value), "value");
		}

		public override string ToString()
		{
			return this.Value ? "true" : "false";
		}
	}
}
